/**
 * @author ChuwxNTC
 * Class LocationUtility
 * Date created 2012-09-28 
 */

package hcmute.pps.common.utility;

import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
import android.util.Log;

/**
 * @author ChuwxNTC
 * 
 */
public class LocationUtility implements LocationListener {
	private static final String TAG = "BOOMLOCATION";
	private Location location;
	private static double latitude;
	private static double longitude;

	/**
	 * @return the latitude
	 */
	public static double getLatitude() {
		return latitude;
	}

	/**
	 * @return the longitude
	 */
	public static double getLongitude() {
		return longitude;
	}

	/**
	 * @return the location
	 */
	public Location getLocation() {
		return location;
	}

	public void onLocationChanged(Location location) {
		Log.e(TAG, "onLocationChanged: " + location);
		location.getLatitude();
		location.getLongitude();
		latitude = location.getLatitude();
		longitude = location.getLongitude();
		this.location.set(location);
	}

	public void onProviderDisabled(String provider) {
		Log.e(TAG, "LocationListener " + provider);
	}

	public void onProviderEnabled(String provider) {
		Log.e(TAG, "onProviderEnabled: " + provider);
	}

	public void onStatusChanged(String provider, int status, Bundle extras) {
		Log.e(TAG, "onStatusChanged: " + provider);
	}
}
